<form id="<?php echo $uniqid;?>" method="post" style="padding: 8px;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >名称：</td>
            <td colspan="3"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入应用名称.."  v-model="params.name">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel"  width="10%">标识符：</td>
            <td colspan="3"><input name="phone" type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入标识符.." required="true" v-model="params.identify"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >状态：</td>
            <td colspan="3">
                <label><input name="status" type="checkbox" class="textbox-prompt" v-model="params.status">激活</label></td>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >排序：</td>
            <td><input name="sortorder" type="text"
                       class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                       placeholder="请输入排序.." v-model="params.sortorder"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >图片：</td>
            <td colspan="3" style="padding-left: 0;">
                <div title="上传图片">
                    <div class="col-md-12">
                        <div id="container" style="background-color:#F9F9F4">
                            <a class="btn btn-default btn-lg" id="appPickfiles<?php echo $uniqid;?>" href="#" style="text-decoration: none;">
                                <div style="padding:18px;"><i class="iconfont icon-xiangji"></i> 点击上传图片...</div>
                            </a>
                        </div>
                    </div>
                    <div style="display:none" id="success" class="col-md-12">
                        <div class="alert-success">
                            队列全部文件处理完毕
                        </div>
                    </div>
                    <div class="col-md-12 ">
                        <table id="uploadtable" class="formtable" id="fsUploadProgressTable1">
                            <tbody id="fsUploadProgress">
                            <template v-if="params.logo">
                                <tr class="progressContainer" style="opacity: 1;">
                                    <td class="progressName">
                                        <div class="gallery"><a class="linkWrapper" target="_blank" :href="params.logo" title="查看原图">
                                            <img width="100%" :src="params.logo+'?imageView2/1/w/100/h/100'">
                                        </a></div>
                                    </td>
                                    <td>
                                        <div class="info" style="display: flex">
                                            <div style="flex: 4"><span style="width: 400px; display: inline-block;word-break: break-all; line-height: 18px;">{{params.logo}}</span></div>
                                            <div style="flex: 1">
                                                <input class='l-btn l-btn-small btn-del' @click="rm()" value="删除图片" type="button">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</form>

<script>
    var appaddVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: {},
        },
        methods: {
            submit: function () {
                $.post('/admin/app/add', appaddVm.params, function (data) {
                    if (data.ret == 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $('#<?php echo $uniqid;?>').form('clear');
                        $("#appdlg").dialog('close');
                        $("#app").datagrid('reload');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            }
        }
    });
    $(function () {
        $('#<?php echo $uniqid;?> #appaddsubmit').click(function (data) {
            appaddVm.submit();
        });
        qiniu_single('appPickfiles<?php echo $uniqid;?>', function (res) {
            appaddVm.$set(appaddVm.params,"logo", res);
        });
    });
</script>
